import * as process from "process";

/**
 * Return different host domain names based on different operating environment
 * @param url
 */
export function hostUrl(url = ""): string {
  if (url[0] !== "/") {
    url = "/" + url;
  }
  if (process.env["OPERATING_ENV "] === "prod") {
    return "https://" + process.env["HOST_DOMAIN"] + ":3000" + url;
  }
  return "http://localhost:3000" + url;
}
